From 512b217b0b24957dcaabfa97d8887e37abe7760d Mon Sep 17 00:00:00 2001 From: Sondre Lefsaker Date: Sat, 2 May 2015 12:19:55 +0200 Subject: [PATCH] Remove the `pkgid` arg and replace the `profile` flag with `package`. --- src/bin/rustc.rs | 36 +++++++++++++++++------------------- tests/test_cargo_rustc.rs | 6 +++--- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/bin/rustc.rs b/src/bin/rustc.rs index 72c8ad98d..431fffd90 100644 --- a/src/bin/rustc.rs +++ b/src/bin/rustc.rs @@ -7,9 +7,8 @@ use cargo::util::{CliResult, CliError, Config}; #[derive(RustcDecodable)] struct Options { - arg_pkgid: Option, arg_opts: Option>, - flag_profile: Option, + flag_package: Option, flag_jobs: Option, flag_features: Vec, flag_no_default_features: bool, @@ -28,23 +27,23 @@ pub const USAGE: &'static str = " Compile a package and all of its dependencies Usage: - cargo rustc [options] [] [--] [...] + cargo rustc [options] [--] [...] Options: - -h, --help Print this message - -p, --profile PROFILE The profile to compile for - -j N, --jobs N The number of jobs to run in parallel - --lib Build only this package's library - --bin NAME Build only the specified binary - --example NAME Build only the specified example - --test NAME Build only the specified test - --bench NAME Build only the specified benchmark - --release Build artifacts in release mode, with optimizations - --features FEATURES Features to compile for the package - --no-default-features Do not compile default features for the package - --target TRIPLE Target triple which compiles will be for - --manifest-path PATH Path to the manifest to fetch depednencies for - -v, --verbose Use verbose output + -h, --help Print this message + -p SPEC, --package SPEC The profile to compile for + -j N, --jobs N The number of jobs to run in parallel + --lib Build only this package's library + --bin NAME Build only the specified binary + --example NAME Build only the specified example + --test NAME Build only the specified test + --bench NAME Build only the specified benchmark + --release Build artifacts in release mode, with optimizations + --features FEATURES Features to compile for the package + --no-default-features Do not compile default features for the package + --target TRIPLE Target triple which compiles will be for + --manifest-path PATH Path to the manifest to fetch depednencies for + -v, --verbose Use verbose output The specified (defaults to the current package) will have all of its dependencies compiled, and then the package itself will be compiled. This @@ -68,7 +67,6 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { config.shell().set_verbose(options.flag_verbose); let root = try!(find_root_manifest_for_cwd(options.flag_manifest_path)); - let spec = options.arg_pkgid.as_ref().map(|s| &s[..]); let opts = CompileOptions { config: config, @@ -76,7 +74,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult> { target: options.flag_target.as_ref().map(|t| &t[..]), features: &options.flag_features, no_default_features: options.flag_no_default_features, - spec: spec, + spec: options.flag_package.as_ref().map(|s| &s[..]), exec_engine: None, mode: ops::CompileMode::Build, release: options.flag_release, diff --git a/tests/test_cargo_rustc.rs b/tests/test_cargo_rustc.rs index ccc90e18b..87fd961a5 100644 --- a/tests/test_cargo_rustc.rs +++ b/tests/test_cargo_rustc.rs @@ -43,7 +43,7 @@ test!(build_lib_for_foo { "#) .file("src/lib.rs", r#" "#); - assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo"), + assert_that(p.cargo_process("rustc").arg("--lib").arg("-v"), execs() .with_status(0) .with_stdout(verbose_output_for_target(true, &p))); @@ -63,7 +63,7 @@ test!(build_lib_and_allow_unstable_options { "#) .file("src/lib.rs", r#" "#); - assert_that(p.cargo_process("rustc").arg("--lib").arg("-v").arg("foo") + assert_that(p.cargo_process("rustc").arg("--lib").arg("-v") .arg("--").arg("-Z").arg("unstable-options"), execs() .with_status(0) @@ -84,7 +84,7 @@ test!(build_main_and_allow_unstable_options { fn main() {} "#); - assert_that(p.cargo_process("rustc").arg("-v").arg("foo") + assert_that(p.cargo_process("rustc").arg("-v") .arg("--").arg("-Z").arg("unstable-options"), execs() .with_status(0) -- 2.30.2